export default {
  namespaced: true,
  state: {
    socket: null,
    dropped: false,
  },
  mutations: {
    SET_SOCKET(state, socket) {
      state.socket = socket;
    },
    SET_DROPPED(state, dropped) {
      state.dropped = dropped;
    }
  },
  actions: {
    // 设置 socket 实例
    setSocket({ commit }, socket) {
      commit('SET_SOCKET', socket);
    },
    // 设置连接状态
    setDropped({ commit }, dropped) {
      commit('SET_DROPPED', dropped);
    }
  }
}